/**
 * 
 */
package acmCoder.ctrip;

import java.util.Scanner;

/**
 * @author zhongfang
 *
 */
public class test2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int a[] = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = scanner.nextInt();
		}
		int m = scanner.nextInt();
		int b[] = new int[m];
		for (int i = 0; i < m; i++) {
			b[i] = scanner.nextInt();
		}
		scanner.close();
		System.out.println(String.format("%.1f", getRes(a, b)));
	}

	private static double getRes(int a[], int b[]) {
		int n = a.length;
		int m = b.length;
		int c[] = new int[m + n];
		int i = 0, j = 0;
		int k = 0;
		while (i < n && j < m) {
			if (a[i] <= b[j]) {
				c[k++] = a[i++];
			} else {
				c[k++] = b[j++];
			}
		}
		while (i < n) {
			c[k++] = a[i++];
		}
		while (j < m) {
			c[k++] = b[j++];
		}
		if (c.length % 2 == 0) {
			return ((double) c[c.length / 2] + c[c.length / 2 - 1]) / 2;
		} else {
			return c[c.length / 2];
		}
	}

}
